import 'package:flutter/material.dart';

class ImageWidget extends StatelessWidget {
  const ImageWidget({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Image组件'),
      ),
      body: Center(
        child: Container(
          width: 300.0,
          height: 400.0,
          color: Colors.red,
          // 展示网络图片
          child: Image.network(
            'https://yanxuan-item.nosdn.127.net/e529b6ab111ade9da9314867f98d360f.png',
            fit: BoxFit.cover,
          ),
        ),
      ),
    );
  }
}